#include "CGame.h"
#include "CEntity.h"
#include "CPlayer.h"
#include "CAIModule_GoTo.h"

CAIModule_GoTo::CAIModule_GoTo(CEntity* host, pair position) : CAIModule(host)
{
    Path.create(gGame->getDungeon()->getFloor(host->getCurrentFloor())->getFovMap(), host->getPosition(), position);
}

// this is unfinished and unused.
int CAIModule_GoTo::action()
{
    if (!Path.isPathOver())
    {
        int x = Host->getPosition().x(), y = Host->getPosition().y();
        Path.move(&x, &y);
        Host->setPosition(pair(x, y));
    }

    return 0;
}

